/**
 * Created by qiangxl on 2017/8/25 0025.
 */
$(function(){
    //$(".mui-segmented-control a").click(function(){
    //    $(".mui-segmented-control a .red").css({'border-bottom': 'none'});
    //    $(this).find('.red').css({'border-bottom': '0.08rem solid #ff3149'});
    //});

    //$("#a01").click(function(){
    //  $("#b02 h5 img").attr({'src': 'images/activity_bnt_n.png'});
    //  $("#c03 h5 img").attr({'src': 'images/my_bnt_n.png'});
    //  $("#a01 h5 img").attr({'src': 'images/home_bnt_s.png'});
    //});
    //$("#b02").click(function(){
    //    $("#a01 h5 img").attr({'src': 'images/home_bnt_n.png'});
    //    $("#c03 h5 img").attr({'src': 'images/my_bnt_n.png'});
    //    $("#b02 h5 img").attr({'src': 'images/activity_bnt_s.png'});
    //});
    //$("#c03").click(function(){
    //    $("#a01 h5 img").attr({'src': 'images/home_bnt_n.png'});
    //    $("#b02 h5 img").attr({'src': 'images/activity_bnt_n.png'});
    //    $("#c03 h5 img").attr({'src': 'images/my_bnt_s.png'});
    //});
    //$("#show li").mouseout(function(){
    //    $(this).find('p').stop().slideToggle();
    //    //$(this).find('p').stop().slideToggle();
    //});
    $("#search").focus(function(){
        window.location.href = "search.html";
    });
    $(".details li").click(function(){
        window.location.href = "details/index.html";
    });
    $("#rule").click(function(){
        window.location.href = "activity/rules.html";
    })
    $("#qd").click(function(){
        console.log(this.src);
       this.src = "images/my/sign_personal_bnt_s.png";
    })
    $(".icon").click(function(){
        console.log(this);
        window.location.href = "my/index.html";
    })
});
window.onload =function(){
    var a = document.getElementById("a01");
    var b = document.getElementById("b02");
    var c = document.getElementById("c03");
    var d = document.getElementById("d04");
    var a1 = document.getElementById("a1");
    var b2 = document.getElementById("b2");
    var c3 = document.getElementById("c3");
    var d4 = document.getElementById("d4");
    a.addEventListener("touchstart",function(){
        b2.src="images/activity_bnt_n.png";
        c3.src="images/list_bnt_n.png";
        d4.src="images/my_bnt_n.png";
        a1.src="images/home_bnt_s.png";
    });
    b.addEventListener("touchstart",function(){
        a1.src="images/home_bnt_n.png";
        c3.src="images/list_bnt_n.png";
        d4.src="images/my_bnt_n.png";
        b2.src="images/activity_bnt_s.png";
    });
    c.addEventListener("touchstart",function(){
        a1.src="images/home_bnt_n.png";
        b2.src="images/activity_bnt_n.png";
        d4.src="images/my_bnt_n.png";
        c3.src="images/list_bnt_s.png";
    });
    d.addEventListener("touchstart",function(){
        a1.src="images/home_bnt_n.png";
        b2.src="images/activity_bnt_n.png";
        c3.src="images/list_bnt_n.png";
        d4.src="images/my_bnt_s.png";
    });
    //var boxs = document.getElementsByClassName("mui-control-item");
    //var reds = document.getElementsByClassName("red");
    //for (var i = 0; i < reds.length; i++) {
    //    reds[i].addEventListener("touchstart",function(){
    //        for (var i = 0; i < reds.length; i++) {
    //            reds[i].className = "red"
    //        }
    //        this.className = "red act"
    //    });
    //}
};
(function (doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function () {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            if(clientWidth>=1080){
                docEl.style.fontSize = '100px';
            }else{
                docEl.style.fontSize = 100 * (clientWidth / 1080) + 'px';
            }
        };

    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);


